package com.xbongbong.workflow.service.operator;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.domain.entity.ext.PaasFormDataEntityExt;
import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.workflow.domain.entity.WorkflowNodeEntity;
import com.xbongbong.paas.pojo.workflow.WorkflowDataPojo;
import com.xbongbong.paas.pojo.workflow.WorkflowExplainPojo;
import com.xbongbong.workflow.pojo.WorkflowOperationsPojo;
import com.xbongbong.workflow.pojo.WorkflowTransferPOJO;

import java.util.Map;

/**
 * @author 吴峰
 * @date 2021/06/18 15:08
 */
public interface WorkflowOperatorService {
    /**
     * 返回
     * @return
     */
    Integer type();

    /**
     * 多数据源的插入操作
     * @param workflowNodeEntity
     * @param fieldAttrEntity
     * @param targetField
     * @param formDataMap
     * @param dataMap
     * @param workflowOperationsPojo
     * @param workflowDataPojo
     * @param workflowExplainPojo 字段容器
     * @param workflowTransferPojo 流转容器
     * @return
     * @throws XbbException
     */
    Object operatorByInsertNodeSourceData(WorkflowNodeEntity workflowNodeEntity, FieldAttrEntity fieldAttrEntity, FieldAttrEntity targetField, Map<Long, PaasFormDataEntityExt> formDataMap,
                    Map<Long, JSONObject> dataMap, WorkflowOperationsPojo workflowOperationsPojo, WorkflowDataPojo workflowDataPojo, WorkflowTransferPOJO workflowTransferPojo,
                                          WorkflowExplainPojo workflowExplainPojo) throws XbbException;


    /**
     * 多数据源的插入操作
     * @param workflowNodeEntity
     * @param fieldAttrEntity
     * @param targetField
     * @param formDataMap
     * @param dataMap 以workflowNodeId为key的容器
     * @param workflowOperationsPojo
     * @param workflowDataPojo
     * @param workflowExplainPojo 字段容器
     * @param workflowTransferPojo 流转容器
     * @return
     * @throws XbbException
     */
    Object operatorByUpdateNode(WorkflowNodeEntity workflowNodeEntity, FieldAttrEntity fieldAttrEntity, FieldAttrEntity targetField, Map<Long, PaasFormDataEntityExt> formDataMap,
                                Map<Long, JSONObject> dataMap, WorkflowOperationsPojo workflowOperationsPojo, WorkflowDataPojo workflowDataPojo,
                                WorkflowTransferPOJO workflowTransferPojo, WorkflowExplainPojo workflowExplainPojo) throws XbbException;



}
